package com.qq.weixin.mp.message.hxexp.model.receive;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import com.hxexp.weixin.common.jaxb.CDATAAdapter;

/**
 * 图片消息
 * @author li.jiang
 *
 */
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)
public final class ImageMsgJaxb extends BaseMsgJaxb {

    private static final long serialVersionUID = 6435197863018970238L;
    /**
     * 图片链接
     */
    @XmlElement(name = "PicUrl")
    @XmlJavaTypeAdapter(value=CDATAAdapter.class)
    private String picUrl;
    /**
     * 图片消息媒体id，可以调用多媒体文件下载接口拉取数据
     */
    @XmlElement(name = "MediaId")
    @XmlJavaTypeAdapter(value=CDATAAdapter.class)
    private String mediaId;
    /**
     * 消息id，64位整型
     */
    @XmlElement(name = "MsgId")
    private long msgId;
    /**
     * 构造函数
     */
    public ImageMsgJaxb() {
        super();
    }
    /**
     * @return the picUrl
     */
    public String getPicUrl() {
        return picUrl;
    }
    /**
     * @param picUrl the picUrl to set
     */
    public void setPicUrl(String picUrl) {
        this.picUrl = picUrl;
    }
    /**
     * @return the mediaId
     */
    public String getMediaId() {
        return mediaId;
    }
    /**
     * @param mediaId the mediaId to set
     */
    public void setMediaId(String mediaId) {
        this.mediaId = mediaId;
    }
    /**
     * @return the msgId
     */
    public long getMsgId() {
        return msgId;
    }
    /**
     * @param msgId the msgId to set
     */
    public void setMsgId(long msgId) {
        this.msgId = msgId;
    }
    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return String
                .format("ImageMsgJaxb [picUrl=%s, mediaId=%s, msgId=%s, getToUserName()=%s, getFromUserName()=%s, getCreateTime()=%s, getMsgType()=%s]",
                        picUrl, mediaId, msgId, getToUserName(), getFromUserName(), getCreateTime(), getMsgType());
    }
}
